import axios from 'axios';

let base = 'https://api.dropoutstudio.cn/shifang/index.php';
axios.defaults.withCredentials = true;
//登录
export const requestLogin = params => { return axios.post(`${base}/adminUser/login`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//学生列表，可用于学生认证
export const getStudentIdentify = params => { return axios.get(`${base}/adminUser/studentIdentify`, { params: params }); };
//审核用户的学生认证
export const studentUpdate = params => { return axios.post(`${base}/adminUser/studentUpdate`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//创建任务
export const createTask = params => { return axios.post(`${base}/adminTask/createTask`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//任务领取状态列表，所有正在进行的任务
export const getTaskObtainList = params => { return axios.get(`${base}/adminTask/taskObtainList`, { params: params }); };
//领取任务详情
export const getTaskObtainDetail = params => { return axios.get(`${base}/adminTask/taskObtainDetail`, { params: params }); };
//某个任务的申请详情（申请延期、申请取消）
export const getTaskApplyDetail = params => { return axios.get(`${base}/adminTask/taskApplyDetail`, { params: params }); };
//后台确认一个任务（提交给委托方--好像这里要退还押金？？）
export const confirmTask = params => { return axios.post(`${base}/adminTask/confirmTask`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//后台同意延期任务（缺少扣钱、退还押金）
export const delayTask = params => { return axios.post(`${base}/adminTask/delayTask`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//后台同意取消任务（缺少扣钱、退还押金）
export const cancelTask = params => { return axios.post(`${base}/adminTask/cancelTask`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//委托方同意/不同意方案，需要修改
export const updateTask = params => { return axios.post(`${base}/adminTask/updateTask`, JSON.stringify(params),{headers: {'Content-Type': 'text/plain'}}).then(res => res.data); };
//后台上传图片
export const uploadcover = `${base}/adminTask/do_upload`;
//统计列表
export const getStatistic = params => { return axios.get(`${base}/adminStatistic/statisticIndex`, { params: params }); };
//打款详情
export const getObtainAwardDetail = params => { return axios.get(`${base}/adminTask/taskObtainAwardDetail`, { params: params }); };





export const getUserList = params => { return axios.get(`${base}/user/list`, { params: params }); };

export const getUserListPage = params => { return axios.get(`${base}/user/listpage`, { params: params }); };

export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); };

export const batchRemoveUser = params => { return axios.get(`${base}/user/batchremove`, { params: params }); };

export const editUser = params => { return axios.get(`${base}/user/edit`, { params: params }); };

export const addUser = params => { return axios.get(`${base}/user/add`, { params: params }); };